/**
 * Copyright (c) 2012 Fujian FUNO Mobile Communication Technology Co., Ltd.
 * All rights reserved by FUNO.
 */
package com.chinamobile.client1;

import org.apache.axis.client.Stub;

import com.chinamobile.axis1.AddressInfo;
import com.chinamobile.axis1.OrderService;
import com.chinamobile.axis1.OrderServiceLocator;
import com.chinamobile.axis1.OrderServicePortType;
import com.chinamobile.axis1.SubscribeServInfo;
import com.chinamobile.axis1.UnSubscribeService;
import com.chinamobile.axis1.UnSubscribeServiceReq;
import com.chinamobile.axis1.UnSubscribeServiceResponse;

/**
 * axis1
 * 
 * <hr/>
 * <b>@date 2012-9-28:</b> 新建
 * <hr/>
 * 
 * @author linzhiwei
 * @version 1.0
 */
public class Axis1UnSubscribe {

	public int unSubscribe(String oprTime, String effTime, String expireTime, String feeUser_ID, String destUser_ID,
			String actionReasonID, String servType, String subServType, String accessMode, String feeType,
			String timestamp ,String transactionID) throws Exception {

		OrderService orderService = new OrderServiceLocator();
		OrderServicePortType portType = orderService.getOrderServiceHttpPort();
		((Stub) portType)._setProperty(org.apache.axis.MessageContext.HTTP_TRANSPORT_VERSION,
				org.apache.axis.transport.http.HTTPConstants.HEADER_PROTOCOL_V11);

		SubscribeServInfo subscribeServInfo = new SubscribeServInfo();
		// oprTime, effTime,expireTime,feeUser_ID,destUser_ID,actionReasonID
		// servType,subServType,accessMode,feeType
		subscribeServInfo.setOprTime(oprTime);
		subscribeServInfo.setEffTime(effTime);
		subscribeServInfo.setExpireTime(expireTime);
		subscribeServInfo.setFeeUser_ID(feeUser_ID);
		subscribeServInfo.setDestUser_ID(destUser_ID);
		subscribeServInfo.setActionReasonID(actionReasonID);
		subscribeServInfo.setServType(servType);
		subscribeServInfo.setSubServType(subServType);
		subscribeServInfo.setAccessMode(accessMode);
		subscribeServInfo.setFeeType(feeType);

		UnSubscribeServiceReq unSubscribeServiceReq = new UnSubscribeServiceReq(subscribeServInfo);
		UnSubscribeService parameters = new UnSubscribeService(unSubscribeServiceReq);

		UnSubscribeServiceResponse resp = portType.unSubscribeService(parameters, "unSubscribeServiceReq", transactionID, "1.0.0", new AddressInfo("229024", "591"), new AddressInfo("100000", "591"), new AddressInfo("229024",
				"591"), timestamp);
		
        
		return resp.getUnSubscribeServiceResp().getResult();
	}
}
